3.214 \(\int \frac{\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=64 \[ \frac{b \log \left (a+b \tan ^2(e+f x)\right )}{2 a f (a-b)}+\frac{\log (\cos (e+f x))}{f (a-b)}+\frac{\log (\tan (e+f x))}{a f} \]

[Out]

Log[Cos[e + f*x]]/((a - b)*f) + Log[Tan[e + f*x]]/(a*f) + (b*Log[a + b*Tan[e + f*x]^2])/(2*a*(a - b)*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0823578, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3670, 446, 72} \[ \frac{b \log \left (a+b \tan ^2(e+f x)\right )}{2 a f (a-b)}+\frac{\log (\cos (e+f x))}{f (a-b)}+\frac{\log (\tan (e+f x))}{a f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

Log[Cos[e + f*x]]/((a - b)*f) + Log[Tan[e + f*x]]/(a*f) + (b*Log[a + b*Tan[e + f*x]^2])/(2*a*(a - b)*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{\cot (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1}{x \left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{x (1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{a x}-\frac{1}{(a-b) (1+x)}+\frac{b^2}{a (a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\log (\cos (e+f x))}{(a-b) f}+\frac{\log (\tan (e+f x))}{a f}+\frac{b \log \left (a+b \tan ^2(e+f x)\right )}{2 a (a-b) f}\\ \end{align*}

Mathematica [A]  time = 0.0499152, size = 57, normalized size = 0.89 \[ \frac{b \log \left (a+b \tan ^2(e+f x)\right )+2 (a-b) \log (\tan (e+f x))+2 a \log (\cos (e+f x))}{2 a f (a-b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

(2*a*Log[Cos[e + f*x]] + 2*(a - b)*Log[Tan[e + f*x]] + b*Log[a + b*Tan[e + f*x]^2])/(2*a*(a - b)*f)

________________________________________________________________________________________

Maple [A]  time = 0.067, size = 76, normalized size = 1.2 \begin{align*}{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{2\,fa}}+{\frac{b\ln \left ( a \left ( \cos \left ( fx+e \right ) \right ) ^{2}- \left ( \cos \left ( fx+e \right ) \right ) ^{2}b+b \right ) }{2\,fa \left ( a-b \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{2\,fa}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)/(a+b*tan(f*x+e)^2),x)

[Out]

1/2/f/a*ln(cos(f*x+e)+1)+1/2/f*b/a/(a-b)*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)+1/2/f/a*ln(cos(f*x+e)-1)

________________________________________________________________________________________

Maxima [A]  time = 1.05104, size = 66, normalized size = 1.03 \begin{align*} \frac{\frac{b \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{2} - a b} + \frac{\log \left (\sin \left (f x + e\right )^{2}\right )}{a}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*(b*log(-(a - b)*sin(f*x + e)^2 + a)/(a^2 - a*b) + log(sin(f*x + e)^2)/a)/f

________________________________________________________________________________________

Fricas [A]  time = 1.20025, size = 169, normalized size = 2.64 \begin{align*} \frac{{\left (a - b\right )} \log \left (\frac{\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + b \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left (a^{2} - a b\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*((a - b)*log(tan(f*x + e)^2/(tan(f*x + e)^2 + 1)) + b*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)))/((
a^2 - a*b)*f)

________________________________________________________________________________________

Sympy [A]  time = 16.7503, size = 398, normalized size = 6.22 \begin{align*} \begin{cases} \frac{\tilde{\infty } x \cot{\left (e \right )}}{\tan ^{2}{\left (e \right )}} & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac{- \frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{\log{\left (\tan{\left (e + f x \right )} \right )}}{f}}{a} & \text{for}\: b = 0 \\\frac{\frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - \frac{\log{\left (\tan{\left (e + f x \right )} \right )}}{f} - \frac{1}{2 f \tan ^{2}{\left (e + f x \right )}}}{b} & \text{for}\: a = 0 \\- \frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 a f \tan ^{2}{\left (e + f x \right )} + 2 a f} - \frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f \tan ^{2}{\left (e + f x \right )} + 2 a f} + \frac{2 \log{\left (\tan{\left (e + f x \right )} \right )} \tan ^{2}{\left (e + f x \right )}}{2 a f \tan ^{2}{\left (e + f x \right )} + 2 a f} + \frac{2 \log{\left (\tan{\left (e + f x \right )} \right )}}{2 a f \tan ^{2}{\left (e + f x \right )} + 2 a f} + \frac{1}{2 a f \tan ^{2}{\left (e + f x \right )} + 2 a f} & \text{for}\: a = b \\\frac{x \cot{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\- \frac{a \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f - 2 a b f} + \frac{2 a \log{\left (\tan{\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} + \frac{b \log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} + \frac{b \log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} - \frac{2 b \log{\left (\tan{\left (e + f x \right )} \right )}}{2 a^{2} f - 2 a b f} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*cot(e)/tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + log(ta
n(e + f*x))/f)/a, Eq(b, 0)), ((log(tan(e + f*x)**2 + 1)/(2*f) - log(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2))
/b, Eq(a, 0)), (-log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*a*f*tan(e + f*x)**2 + 2*a*f) - log(tan(e + f*x)**
2 + 1)/(2*a*f*tan(e + f*x)**2 + 2*a*f) + 2*log(tan(e + f*x))*tan(e + f*x)**2/(2*a*f*tan(e + f*x)**2 + 2*a*f) +
 2*log(tan(e + f*x))/(2*a*f*tan(e + f*x)**2 + 2*a*f) + 1/(2*a*f*tan(e + f*x)**2 + 2*a*f), Eq(a, b)), (x*cot(e)
/(a + b*tan(e)**2), Eq(f, 0)), (-a*log(tan(e + f*x)**2 + 1)/(2*a**2*f - 2*a*b*f) + 2*a*log(tan(e + f*x))/(2*a*
*2*f - 2*a*b*f) + b*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a**2*f - 2*a*b*f) + b*log(I*sqrt(a)*sqrt(1/b)
+ tan(e + f*x))/(2*a**2*f - 2*a*b*f) - 2*b*log(tan(e + f*x))/(2*a**2*f - 2*a*b*f), True))

________________________________________________________________________________________

Giac [A]  time = 1.44647, size = 80, normalized size = 1.25 \begin{align*} \frac{\frac{b \log \left ({\left | -a \sin \left (f x + e\right )^{2} + b \sin \left (f x + e\right )^{2} + a \right |}\right )}{a^{2} - a b} + \frac{\log \left (\sin \left (f x + e\right )^{2}\right )}{a}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/2*(b*log(abs(-a*sin(f*x + e)^2 + b*sin(f*x + e)^2 + a))/(a^2 - a*b) + log(sin(f*x + e)^2)/a)/f